package com.zcyh.exam;

import com.zcyh.exam.utils.FileUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
@MapperScan("com.zcyh.exam.mapper")
@ServletComponentScan
public class ExamServiceApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(ExamServiceApplication.class, args);
        Environment environment = applicationContext.getEnvironment();
        String uploadPath = environment.getProperty("file.uploadPath");
        FileUtils.setUploadPath(uploadPath);
    }

}
